package com.kcht.sylyg08.dao.impl;

import com.kcht.adp.common.log.Logger;
import com.kcht.adp.common.sql.JPAConfig;
import com.kcht.sylyg08.dao.DataSourceBaseDao;
import com.kcht.sylyg08.dao.IContainerDao;
import com.kcth.sylyg08.entity.Container;

import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;
import java.util.List;

/**
  *
  * @Package:        com.kcht.sylyg08.dao.impl
  * @Description:     java类作用描述
  * @Author:         lenovo
  * @CreateDate:     2019/5/15 14:08
 */
@Singleton
@Startup
@JPAConfig(dynaSqlFile = "mapper/containerQueryMapper.xml")
public class ContainerDao extends DataSourceBaseDao<Container,Long> implements IContainerDao {
    @Inject
    private Logger log;

    /**
     *
     * @param containerId
     * @return
     */
    @Override
    public Container get(String containerId){
        return this.selectOneByJPQL("select a from Container a where a.containerId='"+containerId+"'");
    }

    /**
     *
     * @return
     */
    @Override
    public List<Container> list(){
        return this.selectListByJPQL("select a from Container a");
    }
}
